home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / fgl105c.zip / 09-11.C < prev    next >
Text File  |  1991-05-05  |  584b  |  30 lines

  1. char triangle[] = {
  2.    0x17,9,1, 0x12,1,5, 0x17,1,3, 0x12,1,3,
  3.    0x17,1,5, 0x12,1,1, 0x17,1,7, 0x17,1,4
  4.    };
  5.  
  6. main()
  7. {
  8.    int old_mode, new_mode;
  9.  
  10.    new_mode = fg_bestmode(320,200,1);
  11.    if (new_mode < 0 || new_mode == 12) {
  12.       printf("This program requires a 320 ");
  13.       printf("x 200 color graphics mode.\n");
  14.       exit();
  15.       }
  16.  
  17.    old_mode = fg_getmode();
  18.    fg_setmode(new_mode);
  19.  
  20.    fg_setcolor(7);
  21.    fg_rect(0,319,0,199);
  22.  
  23.    fg_move(156,101);
  24.    fg_displayp(triangle,16,9);
  25.    fg_waitkey();
  26.  
  27.    fg_setmode(old_mode);
  28.    fg_reset();
  29. }
  30.